import request from '@/utils/request';

//查看我提交的随手拍
export function loockMySubmit(data) {
  return request({
      url: '/randomly_snap_picture/my_submit/',
      method: 'get',
      params:{
        page:data.page.pageNum,
        size:data.page.pageSize,
        start_time:data.startTime,
        end_time:data.endTime,
        type:data.type
      }
  })
}

//创建随手拍
export function addPhoto(data) {
  return request({
      url: '/randomly_snap_picture/',
      method: 'post',
      data:data
  })
}

//查看我分配的随手拍
export function loockDistribution(data) {
  return request({
      url: '/randomly_snap_picture/my_allot/',
      method: 'get',
      params:{
        page:data.page.pageNum,
        size:data.page.pageSize,
        start_time:data.startTime,
        end_time:data.endTime,
        type:data.type
      }
  })
}

//查看我的随手拍任务
export function loockMyTask(data) {
  return request({
      url: '/randomly_snap_picture/my_task/',
      method: 'get',
      params:{
        page:data.page.pageNum,
        size:data.page.pageSize,
        start_time:data.startTime,
        end_time:data.endTime,
        type:data.type
      }
  })
}

//查看我分配的随手拍详情
export function loockDistributionDetails(id) {
  return request({
      url: `/randomly_snap_picture/${id}/my_allot_detail/`,
      method: 'get',
  })
}

//提交方管理员分配随手拍
export function submitDistribution(id,data) {
  return request({
      url: `/randomly_snap_picture/${id}/allot/`,
      method: 'post',
      data:data
  })
}

//接收方管理员分配随手拍
export function receiveDistribution(id,data) {
  return request({
      url: `/randomly_snap_picture/${id}/other_allot/`,
      method: 'post',
      data:data
  })
}

//查看我的随手拍任务详情
export function taskDetails(id) {
  return request({
      url: `/randomly_snap_picture/${id}/my_task_detail/`,
      method: 'get',
  })
}

//查看我提交的随手拍详情
export function subimtDetails(id) {
  return request({
      url: `/randomly_snap_picture/${id}/my_submit_detail/    `,
      method: 'get',
  })
}

//工人提交移交或者审批
export function taskApproval(id,data) {
  return request({
      url: `/randomly_snap_picture/${id}/task/`,
      method: 'post',
      data:data
  })
}

//管理员审批
export function addminApproval(id,data) {
  return request({
      url: `/randomly_snap_picture/${id}/approve/`,
      method: 'post',
      data:data
  })
}